import _ from 'lodash'
//公共词条
 let term = {
    public:{
        checkAction:{
            value:'Action 返回类型不符合预期 (检查组件ID:${InstanceCode}数据源设置)',
            ReferenceExpr: "Schema.Controls.PublicTerms.public.checkAction",
        },
        determine:{
            value:'确定',
            ReferenceExpr: "Schema.Controls.fas_advquery_1_1.Terms.button.confirm",
        },
        cancel: {
            value: "取消",
            ReferenceExpr: "Schema.Controls.fas_advquery_1_1.Terms.button.cancel",
          },
          help:{
            value: "帮助",
            ReferenceExpr: "Schema.Controls.PublicTerms.public.checkAction",
          },
          gotIt: {
            value: "知道了",
            ReferenceExpr: "Schema.Controls.fas_advquery_1_1.Terms.title.button",
          },
          linkIsNull: {
            value: "外链地址为空",
            ReferenceExpr: "Schema.Controls.PublicTerms.public.linkIsNull",
          },
          notInContent: {
            value: "本地变量在表达式上下文中不存在",
            ReferenceExpr: "Schema.Controls.PublicTerms.public.notInContent",
          },
        //   check相关
        
        
    },
    verification:{
        pass:{
            value: "通过",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.pass",
        },
        url:{
            
            value: "url格式不符合",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.url",
        },
        email:{
            
            value: "email格式不符合",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.email",
        },
        phone:{
            value: "电话格式不符合",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.phone",
            
        },
        empty:{
            value: "字段不能为空",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.empty",
            
        },
        lessThan:{
            value: "输入值小于期望的最小值",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.lessThan",
        },
        moreThan:{
            value: "输入值大于期望的最大值",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.moreThan",
        },
        limit:{
            value: "超过精度${value}位小数限制",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.limit",
        },
        lessThan_length:{
            value: "输入长度超过期望长度",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.lessThan_length",
        },
        moreThan_length:{
            value: "输入长度超过期望长度",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.moreThan_length",
        },
        regExp:{
            value: "输入内容不符正则",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.regExp",
            
        },
        invalid:{
            value: "输入值不是有效值",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.invalid",
        },
        contain:{
            value: "输入值不能包含",
            ReferenceExpr: "Schema.Controls.PublicTerms.verification.contain",
            
        }

        
      },
    comm_globel:{
        
    }
}
for(let i in term){
    for(let j  in term[i]){
       let data =  term[i][j].ReferenceExpr.split(".").reduce((prev, cur) => {
        try {
          if (!!prev[cur]) {
            return prev[cur];
          } else {
            return term[i][j].value
          
          }
        } catch (error) {
          return term[i][j].value
        
        }
      }, _.cloneDeep(window.localMessage?localMessage['fas_common']:{}));
      term[i][j]=data
    }
}
export const PUBLICTERMS = term
